/*
 * Copyright (c) 2016- 2020 qolome.com Inc. All Rights Reserved.
 * ProjectName: qolome-knowledge
 * FileName: PowerAdapter.java
 * Author: jiangfeng@qolome.com
 * Date: 2020/3/11 下午5:16
 * LastModified: 2020/03/11 16:11:11
 */

package com.qolome.knowledge.design.pattern.adapter.demo.power.objectadapter;


import lombok.extern.slf4j.Slf4j;

/**
 * @author Qolome
 * @version V1.0
 * @Description 电源适配器
 * @date 2020年 03月11日 16:04:36
 */
@Slf4j
public class PowerAdapter implements DC5V{

    private AC220V ac220V;

    public PowerAdapter(AC220V ac220V){
        this.ac220V = ac220V;
    }

    @Override
    public int out5V() {

       int in = ac220V.outAC220V();
        log.info("输入AC电压:{}",in);
        int out = in/44;
        log.info("输出DC电压:{}",out);
        return out;
    }
}
